<!DOCTYPE html>
<html>
<#include "../head.html">
<link rel="stylesheet" type="text/css" href="${webroot}/plugins/fancybox/jquery.fancybox-1.3.4.css" />
    <body class="full">
    <div class="mc">
        <div class="mc-l">
            <!--左侧导航---{-->
            <div id="navPanelContainer">
                <div class="system-logo cd"></div>
                <!--管理员信息---{-->
                <#include "../adminInfo.html">
                    <!--管理员信息---}-->
                    <div class="nav-wrap">
                        <#include "left.html">
                    </div>
            </div>
            <!--左侧导航---}-->
        </div>
        <div class="mc-m">
            <div class="navToggle"></div>
        </div>
        <div class="mc-r">
            <!--顶部导航---{-->
            <#include "../topNav.html">
                <!--顶部导航---}-->

                <!--面包屑导航---{-->
                <#assign moduleName="运营审核">

                    <#include "banner.html">
                        <!--面包屑导航---}-->

                        <!--工具栏--{-->
                        <div id="toolbar" class="clearfix">

                            <div class="toolbor-module">

                                <input type="button" class="input-button return" value="返回" onclick="javascript:location.href='showTrialBorrow.html'">
                            </div>
                        </div>
                        <!--工具栏--}-->

                        <div id="main" class="clearfix">
                            <form name="form1" method="post" action="" onsubmit="return submitCheck();" enctype="multipart/form-data">

                                <div class="valBox mb15">
                                    <div class="top">
                                        <strong>借款标详情</strong>
                                    </div>
                                    <div class="fp w349 clearfix">
                                        <ul>
                                            <li>
                                                <div class="title">借款标题：</div>
                                                <div class="v">${b.name!''}</div>
                                            </li>
                                            <li>
                                                <div class="title">借贷总金额：</div>
                                                <div class="v">
                                                    ${b.account!}
                                                    <input type="hidden" name="account" value="50000" /> 元
                                                </div>
                                            </li>
                                            <li>
                                                <div class="title">年利率：</div>
                                                <div class="v">
                                                    ${b.apr!} %
                                                </div>
                                            </li>
                                            <li>
                                                <div class="title">奖励：</div>
                                                <div class="v">
                                                    <#if b.award??>
                                                        <#if b.award == 1>
                                                            ${b.partAccount!}%
                                                            <#elseif b.award == 2>
                                                                ${b.funds!}元
                                                                <#else>
                                                                    无
                                                        </#if>
                                                        <#else>
                                                            无
                                                    </#if>
                                                </div>
                                            </li>
                                            <li>
                                                <div class="title">借款期限：</div>
                                                <div class="v">
                                                    <#if b.isday==1>${b.timeLimitDay!"-"}天<#else>${b.timeLimit!"-"}个月</#if>
                                                </div>
                                            </li>
                                            <li>
                                                <div class="title">还款方式：</div>
                                                <div class="v">
                                                    <#if b.isday??&&b.isday==1&&b.type!=112>到期一次性还本付息<#elseif
                                                            b.type ==100>系统自动还款<#elseif b.type==110>到期一次性还本付息
                                                        <#elseif b.style??&&b.style==2>到期一次性还本付息
                                                            <#elseif b.style??&&b.style==3>每月付息到期还本
                                                                <#else>等额本息还款</#if>
                                                </div>
                                            </li>
                                            <li>
                                                <div class="title">最低投标金额：</div>
                                                <div class="v">
                                                    <#if b.lowestAccount??&&b.lowestAccount gt 0>${b.lowestAccount}元<#else>无限制</#if>
                                                </div>
                                            </li>
                                            <li>
                                                <div class="title">最多投标总额：</div>
                                                <div class="v">
                                                    <#if b.mostAccount??&&b.mostAccount gt 0>${b.mostAccount}元<#else>无限制</#if>
                                                </div>
                                            </li>
                                            <li>
                                                <div class="title">有效时间：</div>
                                                <div class="v">
                                                    ${b.validTime!}天
                                                </div>
                                            </li>
                                            <li>
                                                <div class="title">是否是定向标：</div>
                                                <div class="v" style="color: red;">
                                                    <#if b.pwd??>
                                                        是
                                                        <#else>
                                                            否
                                                    </#if>
                                                </div>
                                            </li>

                                            <#if b.signDate??>
                                                <li>
                                                    <div class="title">合同签订日期：</div>
                                                    <div class="v">
                                                        ${b.signDate?string("yyyy-MM-dd")}
                                                    </div>
                                                </li>
                                            </#if>
                                        </ul>
                                    </div>
                                </div>


                                <div class="valBox mb15">
                                    <div class="top">
                                        <strong>借款人基本信息</strong>
                                    </div>
                                    <div class="fp w349 clearfix">
                                        <ul>
                                            <li>
                                                <div class="title">用户名：</div>
                                                <div class="v">${b.user.showName!}</div>
                                            </li>
                                            <li>
                                                <div class="title">真实姓名：</div>
                                                <div class="v">${b.user.realName!}</div>
                                            </li>
                                            <li>
                                                <div class="title">性别：</div>
                                                <div class="v"><#if b.user?? && b.user.sex??><#if b.user.sex==1>男<#else>女</#if></#if></div>
                                            </li>
                                            <li>
                                                <div class="title">民族：</div>
                                                <div class="v"><#if b.user.nation??>${b.user.nation.name!}<#else>-</#if></div>
                                            </li>
                                            <li>
                                                <div class="title">出生日期：</div>
                                                <div class="v">${b.user.birthday!}</div>
                                            </li>
                                            <li>
                                                <div class="title">籍贯：</div>
                                                <div class="v"><#if b.user?? && b.user.province??>${b.user.province.name!}<#else>-</#if>&nbsp;
                                                    <#if b.user?? && b.user.city??>${b.user.city.name!}<#else>-</#if>&nbsp;
                                                    <#if b.user?? && b.user.area??>${b.user.area.name!}<#else>-</#if></div>
                                            </li>
                                            <li>
                                                <div class="title">邮箱：</div>
                                                <div class="v">${b.user.email!}</div>
                                            </li>
                                            <li>
                                                <div class="title">手机：</div>
                                                <div class="v">${b.user.phone!}</div>
                                            </li>
                                            <li>
                                                <div class="title">身份号码：</div>
                                                <div class="v">${b.user.cardId!}</div>
                                            </li>

                                        </ul>
                                    </div>
                                </div>
                                <div class="valBox mb15">
                                    <div class="top">
                                        <strong>借款信息</strong>
                                    </div>
                                    <div class="fp w349 clearfix">
                                        <ul>
                                            <li style="float:none;width:auto;height:auto">
                                                <div class="title">借款描述：</div>
                                                <div class="v">${b.content!}</div>
                                            </li>
                                            <li style="float:none;width:auto;height:auto">
                                                <div class="title">还款来源：</div>
                                                <div class="v">${b.repaymentSource!}</div>
                                            </li>
                                            <li style="float:none;width:auto;height:auto">
                                                <div class="title">资金用途：</div>
                                                <div class="v">${b.fundUsage!}</div>
                                            </li>
                                            <li style="float:none;width:auto;height:auto">
                                                <div class="title">债务人信息：</div>
                                                <div class="v">${b.debtorInfo!}</div>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                                <div class="valBox mb15">
                                    <div class="top">
                                        <strong>担保信息</strong>
                                    </div>
                                    <div class="fp w349 clearfix">
                                        <ul>
                                            <#if vouchInfoList?? && vouchInfoList?size gt 0>
                                                <#list vouchInfoList as item>
                                                    <li style="float:none;width:auto;height:auto">
                                                        <div class="title">担保公司名称：</div>
                                                        <div class="v"><b>${item.vouchCompany.name!}</b></div>
                                                    </li>
                                                    <li style="float:none;width:auto;height:auto">
                                                        <div class="title">担保公司介绍：</div>
                                                        <div class="v">${item.vouchCompany.intro!}</div>
                                                    </li>
                                                </#list>
                                                <#else>
                                                    <li style="float:none;width:auto;height:auto">
                                                        <div class="title">担保方式：</div>
                                                        <div class="v">资产管理公司本息担保</div>
                                                    </li>
                                            </#if>
                                        </ul>
                                    </div>
                                </div>
                                <#if b.productType==3>
                                    <div class="valBox mb15">
                                        <div class="top">
                                            <strong>证明资料</strong>
                                        </div>
                                        <div class="fp w349 clearfix">
                                            <ul>
                                                <li>
                                                    <div class="title">信用报告：</div>
                                                    <div class="v"><#if b.certification?? && b.certification[0]?? && b.certification[0]='1'>通过<#else>未通过</#if></div>
                                                </li>
                                                <li>
                                                    <div class="title">身份认证：</div>
                                                    <div class="v"><#if b.certification?? && b.certification[1]?? && b.certification[1]='1'>通过<#else>未通过</#if></div>
                                                </li>
                                                <li>
                                                    <div class="title">工作认证：</div>
                                                    <div class="v"><#if b.certification?? && b.certification[2]?? && b.certification[2]='1'>通过<#else>未通过</#if></div>
                                                </li>
                                                <li>
                                                    <div class="title">还款能力认证：</div>
                                                    <div class="v"><#if b.certification?? && b.certification[3]?? && b.certification[3]='1'>通过<#else>未通过</#if></div>
                                                </li>
                                            </ul>
                                        </div>
                                    </div>
                                </#if>
                                <div class="valBox mb15">
                                    <div class="top">
                                        <strong>借款人上传的文件[共<#if files??>${files?size}</#if>张]</strong>
                                    </div>
                                    <div class="fp w349 clearfix">
                                        <ul>
                                            <#if files??>
                                                <#list files as item>
                                                    <#if item.fileTmp??>
                                                        <li style="height: 120px;width: 120px;margin: 10px 20px;">
                                                            <a rel="pic_pop" href="${item.fileTmp.fileUrl!}">
                                                                <img src="${item.fileTmp.zoomFileUrl!}" alt="" width="120px"/></a>
                                                        </li>
                                                    </#if>
                                                </#list>
                                            </#if>
                                        </ul>
                                        <script src="${webroot}/plugins/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
                                        <script type="text/javascript">
                                            $("a[rel=pic_pop]").fancybox({
                                                'transitionIn': 'none',
                                                'transitionOut': 'none',
                                                'titlePosition': 'over',
                                                'titleFormat': function(title, currentArray, currentIndex, currentOpts) {
                                                    return '<span id="fancybox-title-over">所有资料 ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
                                                }
                                            });
                                        </script>
                                    </div>
                                </div>

                                <div class="valBox mb15">
                                    <div class="top">
                                        <strong>资产管理公司审核备注信息</strong>
                                    </div>
                                    <div class="fp w349 clearfix">
                                        <ul>

                                            <li style="float:none;width:auto;height:auto">
                                                <div class="title">审核备注：</div>
                                                <div class="v">${b.verifyRemark!}</div>
                                            </li>
                                            <li style="float:none;width:auto;height:auto">
                                                <div class="title">风险评估：</div>
                                                <div class="v">${b.riskEvaluation!}</div>
                                            </li>
                                            <li>
                                                <div class="title">担保方式：</div>
                                                <div class="v">本息担保</div>
                                            </li>
                                            <li>
                                                <div class="title">垫付期限：</div>
                                                <div class="v">${b.repayDay!0}天</div>
                                            </li>
                                            <li>
                                                <div class="title">逾期罚息：</div>
                                                <div class="v">${b.lateInterest!0}</div>
                                            </li>
                                        </ul>
                                    </div>
                                </div>

                                <div class="add-time">
                                    <span class="mr25"><strong>添加时间：</strong>${b.addtime?string('yyyy-MM-dd HH:mm:ss')}</span>
                                    <span><strong>IP：</strong>${b.addip!}</span>
                                </div>

                                <div id="audit">
                                    <div class="top">
                                        <strong>审核此借款<#if b.isAdvanceRepay == 1><span style="color: red;">（该项目为提前还款项目）</span></#if></strong>
                                    </div>
                                    <div class="v">
                                        <div class="c">
                                            <div class="choose s_chooseMb">
                                                <label class="mr15"><input name="status" value="1" type="radio" class="radio">审核通过</label>
                                                <label><input name="status" type="radio" value="2" class="radio" checked="checked">审核不通过</label>
                                                <#if b.status==10>
                                                    <label><input name="status" type="radio" value="33" class="radio">审核通过（自动发标队列）</label>
                                                </#if>
                                                <#if b.status==33>
                                                    <label><input name="status" type="radio" value="10" class="radio">审核不通过（打回终审）</label>
                                                </#if>
                                            </div>


                                            <#if limitDay??>
                                                <div class="choose s_chooseMb">
                                                    <label class="mr15">项目理财时间：</label>
                                                    <label class="mr15">
                                                        <input name="flag" value="1" type="radio" class="radio" checked="checked"/>
                                                        按运营发布时间计算(
                                                        <#if b.isday==1>${b.timeLimitDay!"-"}天<#else>${b.timeLimit!"-"}个月</#if>
                                                        )
                                                    </label>
                                                    <label><input name="flag" type="radio" value="2" class="radio" >按债权生效时间计算(<span>${limitDay}天</span>)</span><span style="color:red;">(债权生效时间：${b.approvalTime?string('yyyy-MM-dd')}<span></span>)</label>
                                                </div>
                                            </#if>

                                            <div class="choose s_chooseMb">
                                                <label class="mr15">年利率：</label>
                                                <label class="mr15">
                                                    <input type="text" id="apr" name="apr" value="${b.apr!''}" style="width:50px"> %
                                                </label>
                                                <label class="mr15"><input name="isNewHand" type="checkbox" value="1" <#if b.isNewHand==1>checked="checked"</#if>>是否新手专享（ <font color="red">若勾选则该项目为新手专享项目，只有新手（无任何投资记录的用户）才能投资，默认为不勾选，所有用户都可投资！</font>）</label>

                                            </div>
                                            <div class="choose s_chooseMb">
                                                <label class="mr15">奖励收益：</label>
                                                <label class="mr15">
                                                    <input type="text" id="extraApr" name="extraApr" value="${b.extraAwardApr!''}"> %
                                                </label>
                                                <label class="mr15">说明  </label>
                                                <label class="mr15">
                                                    <input type="text" id="extraDesc" name="extraDesc">
                                                </label>

                                                <label class="mr15">链接地址 </label>
                                                <label class="mr15">
                                                    <input type="text" id="extraUrl" name="extraUrl" style="width:500px">
                                                </label>

                                            </div>
                                            <div class="choose s_chooseMb">
                                                <label class="mr15">定向密码：</label>
                                                <span class="mr15">
                                            	  		<input type="text" id="pwd" name="pwd" value="<#if b.pwd??>${b.pwd}</#if>" style="width:100px">
                                            	  		<input type="radio"  name="mostLimit" value="1" >单笔最高限制
                                            	  		<input type="radio"  name="mostLimit" value="2" >单人最高限制
                                            	  		<input type="text"  id="mostAmout" name="mostAmout" value="" >
                                            	  </span>

                                            </div>
                                            <div class="choose s_chooseMb">
                                                <label class="mr15">起投金额：</label>
                                                <label class="mr15">
                                                    <input type="text" id="lowestAccount"  name="lowestAccount" value="<#if b.lowestAccount??>${b.lowestAccount?c}</#if>" onkeyup="value=value.replace(/[^0-9.]/g,'')">
                                                </label>

                                            </div>
                                            <div class="choose s_chooseMb">
                                                <label class="mr15">标名后缀：</label>
                                                <label class="mr15">

                                                    <input type="text"   name="suffix" value="<#if b.name.split('\\(')[1]??>(${b.name.split('\\(')[1]!''}</#if>" >
                                                </label>

                                            </div>
                                            <div class="choose s_chooseMb">
                                                <label class="mr15">输入审核备注</label><br>
                                                <textarea  name="secVerifyRemark" id="remark" class="remark" placeholder="输入审核备注..."></textarea>
                                            </div>
                                        </div>
                                        <div class="other clearfix">
                                            <input type="hidden" name="id" value="${(b.id!0)?c}" />
                                            <input type="hidden" id="borrowAccount" value="${(b.account!0)?c}" />
                                            <input type="hidden" name="user_id" value="${(b.user_id!0)?c}" />
                                            <input type="hidden" name="actionType" value="verify" />
                                            <input type="hidden" name="verifyBorrowToken" value="${verifyBorrowToken!}" />
                                            <input type="submit"  name="reset" value="审核此借款标" class="input-button confirm"/>
                                        </div>
                                    </div>
                                </div>

                            </form>

                            <script>

                                function submitCheck(){
                                    var oApr = $("#apr").val();
                                    if(oApr ==""){
                                        alert("利率不能为空！");
                                        return false;
                                    }
                                    if(oApr <= 0 || oApr > 24){
                                        alert("利率区间不符合！");
                                        return false;
                                    }
                                    if($("#remark").val()==""){
                                        alert("备注不能为空！");
                                        return false;
                                    }

                                    var lowestAccount = Number($("#lowestAccount").val());
                                    var mostAmout = Number($("#mostAmout").val());
                                    var borrowAccount =  Number($("#borrowAccount").val());


                                    if(lowestAccount<1){
                                        alert("起投金额不能小于1！");
                                        return false;
                                    }
                                    if(lowestAccount>borrowAccount){
                                        alert("起投金额不能超过借款总额！");
                                        return false;
                                    }
                                    if(mostAmout>borrowAccount){
                                        alert("单笔或单人限额不能超过借款总额！");
                                        return false;
                                    }
                                    if(mostAmout>0 && lowestAccount>=mostAmout){
                                        alert("起投金额不能高于单笔或单人限额！");
                                        return false;
                                    }
                                }

                                $("#apr").bind("keyup",function(){
                                    oThis=$(this);
                                    sVal=oThis.val();
                                    sVal=sVal.replace(/[^0-9.]/g,'');
                                    oThis.val(sVal)
                                })


                                /*             function check_form(){
                                                var frm = document.forms['form1'];
                                                var verify_remark = frm.elements['secVerifyRemark'].value;
                                                var errorMsg = '';
                                                if (verify_remark.length == 0 || verify_remark=='输入审核备注...') {
                                                    errorMsg += '备注必须填写' + '\n';
                                                }

                                                if (errorMsg.length > 0){
                                                    alert(errorMsg); return false;
                                                } else{
                                                    return true;
                                                }
                                            } */

                                function textCount(oThis){
                                    var iCount=0,
                                        iMax=250;
                                    function fnCount(){
                                        iCount=oThis.value.length;
                                        if(iCount>=iMax){
                                            oThis.value=oThis.value.substring(0,iMax);
                                        }
                                    }
                                    oThis.onkeyup=oThis.onchange=fnCount;
                                }
                                textCount(document.getElementById("remark"));
                            </script>
                        </div>
        </div>
    </div>
    <div class="mc-b"><#include "../foot.html"></div>
    <div class="msgClass">${rsmsg!""}</div>
    <#include "../jsPage.html">
    </body>
</html>

